[CmdletBinding()]
param (
    [Parameter()]
    [Bool]
    $Release = $false
)

$target_path = 'debug'
if ($Release) {
    cargo build --release
    $target_path = 'release'
}
else {
    cargo build
}

# todo: 自动查找命令名

rust-objcopy --strip-all ".\target\riscv64gc-unknown-none-elf\$target_path\minimal" `
    -O binary ".\target\riscv64gc-unknown-none-elf\$target_path\minimal.bin"
